﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MainPage : System.Web.UI.Page // ATPages
{
//    ZSql menu = new ZSql();
//ZSql info = new ZSql();

//    protected void Page_Load(object sender, EventArgs e)
//    {
//        if (!IsPostBack)
//        {
//            InitMenu();

//            lblUser.Text = Server.UrlDecode(Request.Cookies["user"].Values["name"]);

//            lblDept.Text = info.GetScalar("select deptname from department where deptid = " + Request.Cookies["user"].Values["deptid"]).ToString();
//        }
//    }

    
//    //初始化菜单数据
//    private void InitMenu()
//    {
//        DataTable menu = GetMenu();

//        TreeViewClass.InitTreeWithUrl(tvMenu, new DataTable[] { menu }, new string[] { "parentid" }, new string[] { "menuid" }, new string[] { "menu" }, null, null, null, new string[] { "url" }, "data");

//        tvMenu.ShowLines = true;

//        TreeViewClass.SetImage(tvMenu, "images/father.gif", "images/father.gif", "images/son.gif");
//    }


//    //根据权限的到菜单数据
//    private DataTable GetMenu()
//    {
//        string sql = "select * from menu where 1=1";

//        if (Server.UrlDecode(Request.Cookies["user"].Values["roleid"]) != "1")
//        {
//            string menuid = "0";

//            info.Open("select permission from purview where roleid = " + Request.Cookies["user"].Values["roleid"] + " or userid = '" + Request.Cookies["user"].Values["id"] + "'");
//            for (int i = 0; i < info.m_table.Rows.Count; i++)
//            {
//                menuid += "," + info.m_table.Rows[i]["permission"].ToString();
//            }

//            sql += " and menuid in (" + menuid + ")";
//        }

//        menu.Open(sql);

//        DataTable dt = menu.m_table;
//        menu.Close();

//        return dt;
//    }
}
